<template>
  <div style="margin-top: 10px">
    <el-card class="box-card">
      <template #header>
        <div class="card-header">
          <span class="search-card-title">
            The role information of {{ phone }}</span
          >
          <el-col
            :span="6"
            :offset="16"
            style="text-align: end; padding-right: 10px"
          >
            <el-button
              size="medium"
              type="primary"
              icon="el-icon-s-fold"
              @click="returnTo()"
              >Return</el-button
            >
          </el-col>
        </div>
      </template>
      <el-row type="flex" justify="center">
        <el-col :span="23">
          <span>
            <el-descriptions title="Role Information" border :column="2">
              <el-descriptions-item
                :labelStyle="{ background: '#e1f3d8' }"
                :contentStyle="{ background: '#FDE2E2' }"
              >
                <template slot="label">
                  <i class="el-icon-user-solid"></i>
                  Nickname
                </template>
                kooriookami
              </el-descriptions-item>

              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-user"></i>
                  Gender
                </template>
                女
              </el-descriptions-item>

              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-star-on"></i>
                  Age
                </template>
                32
              </el-descriptions-item>

              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-mobile-phone"></i>
                  Phone
                </template>
                {{ phone }}
              </el-descriptions-item>

              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-chat-round"></i>
                  WeChat
                </template>
                无边落木萧萧下
              </el-descriptions-item>

              <el-descriptions-item>
                <template slot="label">QQ</template>
                152625424
              </el-descriptions-item>

              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-map-location"></i>
                  Address
                </template>
                陕西省铜川市xx县xx村xx号
              </el-descriptions-item>

              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-message"></i>
                  Email
                </template>
                154135fsdfsd1351@163.com
              </el-descriptions-item>

              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-date"></i>
                  Registration DateTime
                </template>
                2020-03-04 05:12:23
              </el-descriptions-item>

              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-s-custom"></i>
                  Role
                </template>
                <el-tag size="medium">User</el-tag>
              </el-descriptions-item>

              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-star-off"></i>
                  Status
                </template>
                <el-tag size="medium" type="success">activation</el-tag>
              </el-descriptions-item>

              <el-descriptions-item>
                <template slot="label">
                  <i class="el-icon-s-grid"></i>
                  Number of Questionnaires
                </template>
                <el-tag size="medium" type="warning">5</el-tag>
              </el-descriptions-item>
            </el-descriptions>
          </span></el-col
        >
      </el-row>
      <br />
      <el-row type="flex" justify="center">
        <el-col :span="23">
          <el-card class="box-card1">
            <template #header>
              <div class="card-header">
                <span class="search-card-title">Deleted Questionnaire</span>
                <el-col
                  :span="6"
                  :offset="16"
                  style="text-align: end; padding-right: 10px"
                >
                  <el-button
                    size="medium"
                    type="success"
                    icon="el-icon-s-promotion"
                    @click="batchDelete()"
                    >Batch Recovery</el-button
                  >
                </el-col>
              </div>
            </template>
            <el-table
              :data="tableData1"
              style="width: 100%"
              row-key="id"
              border
              @selection-change="handleSelectionChange"
              ><el-table-column type="selection"> </el-table-column>
              <el-table-column
                prop="questionnaireName"
                label="QuestionnaireName"
              >
              </el-table-column>
              <el-table-column prop="number" label="Number" width="280">
              </el-table-column>
              <el-table-column prop="deleteTime" label="Delete Time" sortable>
              </el-table-column>
              <el-table-column prop="status" label="Status">
                <template slot-scope="scope">
                  <div>
                    <el-tag type="danger">Deleted</el-tag>
                  </div>
                </template>
              </el-table-column>

              <el-table-column label="Operations">
                <template slot-scope="scope">
                  <el-button
                    size="mini"
                    type="warning"
                    icon="el-icon-folder-checked"
                    @click="handleDetail(scope.$index, scope.row)"
                    >Detail</el-button
                  >
                  <el-button
                    size="mini"
                    type="success"
                    icon="el-icon-s-promotion"
                    @click="handleRecovery(scope.$index, scope.row)"
                    >Recovery</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
            <br />
            <el-pagination
              :currentPage="pagination.currentPage"
              :page-size="pagination.pageSize"
              :page-sizes="[3, 5, 7, 10]"
              layout="total, sizes, prev, pager, next"
              :total="pagination.totalPages"
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
            />
          </el-card>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      phone: "",
      tableData1: [
        {
          id: 1,
          questionnaireName: "张三的问卷",
          number: "LT-XHDSHD01",
          deleteTime: "2021-05-03 15:32:23",
        },
      ],
      pagination: {
        currentPage: 1,
        pageSize: 3,
        totalPages: 1,
      },
      multipleSelection: [],
    };
  },
  mounted() {
    this.phone = sessionStorage.getItem("phone");
    console.log(sessionStorage.getItem("phone"));
  },
  methods: {
    returnTo() {
      this.$router.push("/systemManagement/userManagement");
    },
    handleDetail() {
      this.$router.push("/questionnaireManagement/questionnaireDetail");
      console.log(index, row);
    },
    handleSelectionChange(val) {
      console.log(val);
      this.multipleSelection = val;
    },

    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
  },
};
</script>

<style scoped lang="scss">
.box-card {
  width: 90%;
  background: rgba(148, 185, 228, 0.062);
  border-radius: 8px;
  margin: auto;
}
.box-card1 {
  background: rgba(148, 185, 228, 0.062);
  border-radius: 8px;
}
.card-header {
  color: #080808;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.search-card-title {
  width: 100%;
  font-size: 16px;
  font-weight: 600;
}
.el-card /deep/.el-card__header {
  background-color: #64bbe742;
  padding: 6px;
}
.my-label {
  background: #e1f3d8;
}
</style>